import 'package:flutter/material.dart';
import 'package:flowerny/model/good.dart';

class TravelDestinationContent extends StatelessWidget {
  const TravelDestinationContent({ Key key, @required this.destination })
      : assert(destination != null),
        super(key: key);

  final Good destination;

  @override
  Widget build(BuildContext context) {
    final ThemeData theme = Theme.of(context);
    final TextStyle descriptionStyle = theme.textTheme.subhead;

    final List<Widget> children = <Widget>[
      // Photo and title.
      Expanded(child: SizedBox(
        child: Stack(
          children: <Widget>[
            Positioned.fill(
              // In order to have the ink splash appear above the image, you
              // must use Ink.image. This allows the image to be painted as part
              // of the Material and display ink effects above it. Using a
              // standard Image will obscure the ink splash.
              child: Ink.image(
                image: NetworkImage(destination.product_img),
                fit: BoxFit.cover,
                child: Container(),
              ),
            ),
          ],
        ),
      ),),
      // Description and share/explore buttons.
      Padding(
        padding: const EdgeInsets.fromLTRB(10.0, 5.0, 12.0, 2.0),
        child: DefaultTextStyle(
          softWrap: false,
          overflow: TextOverflow.ellipsis,
          style: descriptionStyle,
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: <Widget>[
              // three line description
              Padding(
                padding: const EdgeInsets.only(bottom: 2.0),
                child: Text(
                  destination.product_sbu,

                  style: TextStyle(
                    fontSize: 14.0,
                    color: Colors.black54,
                  ),
                ),
              ),
              Text('积分${destination.product_price}',
                style: TextStyle(
                  fontSize: 14.0,
                ),),
            ],
          ),
        ),
      ),
    ];

    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: children,
    );
  }
}